package com.jihox.abookpro.util;

import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;

@SuppressLint("ParcelCreator")
public class AndroidImageFile implements Parcelable{
	private String path;//_data
	private String folderName;
	private int modifiedDate;
	private int orientation;
	public AndroidImageFile() {
	}
	public int getOrientation() {
		return orientation;
	}
	public void setOrientation(int orientation) {
		this.orientation = orientation;
	}
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	
	public String getFolderName() {
		return folderName;
	}
	public void setFolderName(String folderName) {
		this.folderName = folderName;
	}
	public long getModifiedDate() {
		return modifiedDate;
	}
	public void setModifiedDate(int modifiedDate) {
		this.modifiedDate = modifiedDate;
	}
	@Override
	public int describeContents() {
		return 0;
	}
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(path);
		dest.writeString(folderName);
		dest.writeInt(modifiedDate);
		dest.writeInt(orientation);
	}

	public static final Parcelable.Creator<AndroidImageFile> CREATOR
	= new Parcelable.Creator<AndroidImageFile>() {
		@Override
		public AndroidImageFile createFromParcel(Parcel source) {
			AndroidImageFile androidImageFile = new AndroidImageFile();
			androidImageFile.path = source.readString();
			androidImageFile.folderName = source.readString();
			androidImageFile.modifiedDate = source.readInt();
			androidImageFile.orientation = source.readInt();
			return androidImageFile;
		}
		@Override
		public AndroidImageFile[] newArray(int size) {
			return new AndroidImageFile[size];
		}
	};
	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub //如果和自身比较，返回TRUE  
		if(this==o) return true;  
		//如果不是这个类的实例，返回FALSE  
		if(!(o instanceof AndroidImageFile))
			return false;  
		
		final AndroidImageFile u=(AndroidImageFile)o ;
		if(this.getPath().equals(u.getPath()))
			return true;  
		else  
			return false;
	}
}
